#!/bin/bash
set -u;
set -e;
mirror=https://hub.xn--p8jhe.tw
if [ ! -f "$HOME/.config/clash/Country.mmdb" ]; then
# https://raw.xn--p8jhe.tw/Loyalsoldier/geoip/release/Country.mmdb
# https://cdn.jsdelivr.net/gh/Loyalsoldier/geoip@release/Country.mmdb
        wget ${mirror/hub/raw}/Loyalsoldier/geoip/release/Country.mmdb -O ~/.config/clash/Country.mmdb
fi
if [ -f "$HOME/.config/clash/config.yaml" ]; then
        cp -u ~/.config/clash/config.yaml ~/.config/clash/config.yaml.bak
fi
wget --no-proxy "$mirror/pojiezhiyuanjun/freev2/raw/master/$1clash.yml" -O ~/.config/clash/config.yaml